load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")

oncall("fboss_agent_push")

cpp_library(
    name = "cmd_test_utils",
    headers = [
        "CmdHandlerTestBase.h",
        "MockClients.h",
    ],
    exported_deps = [
        "fbsource//third-party/googletest:gmock",
        "fbsource//third-party/googletest:gtest",
        "//fboss/agent/if:ctrl-cpp2-services",
        "//fboss/agent/if:ctrl-cpp2-types",
        "//fboss/cli/fboss2:cmd-common-utils",
        "//fboss/cli/fboss2:cmd-global-options",
        "//fboss/cli/fboss2:fboss2-lib",
        "//fboss/cli/fboss2:options",
        "//fboss/qsfp_service/if:qsfp-cpp2-services",
        "//fboss/qsfp_service/if:transceiver-cpp2-types",
        "//folly:network_address",
        "//folly/io/async:async_socket",
        "//neteng/fboss/bgp/if:bgp_thrift-cpp2-services",
        "//thrift/lib/cpp2/util:util",
    ],
)

cpp_unittest(
    name = "framework_test",
    srcs = [
        "AggregationParsingTest.cpp",
        "AggregationTest.cpp",
        "AggregationValidationTest.cpp",
        "CmdArgsTest.cpp",
        "CmdHelpTest.cpp",
        "FilterTest.cpp",
        "FilterValidationTest.cpp",
    ],
    deps = [
        "fbsource//third-party/googletest:gmock",
        ":cmd_test_utils",
        "//fboss/cli/fboss2:cli-cpp2-types",
        "//fboss/cli/fboss2:cmd-global-options",
        "//fboss/cli/fboss2:fboss2-lib",
        "//fboss/cli/fboss2:ops-utils",
        "//nettools/common:TestUtils",
    ],
)

cpp_unittest(
    name = "cmd_test",
    srcs = [
        "CmdGetPcapTest.cpp",
        "CmdSetPortStateTest.cpp",
        "CmdShowAclTest.cpp",
        "CmdShowAgentSslTest.cpp",
        "CmdShowAggregatePortTest.cpp",
        "CmdShowArpTest.cpp",
        "CmdShowCpuPortTest.cpp",
        "CmdShowExampleTest.cpp",
        "CmdShowFlowletTest.cpp",
        "CmdShowHardwareTest.cpp",
        "CmdShowHostTest.cpp",
        "CmdShowHwAgentStatusTest.cpp",
        "CmdShowHwObjectTest.cpp",
        "CmdShowInterfaceCountersTest.cpp",
        "CmdShowInterfaceErrorsTest.cpp",
        "CmdShowInterfaceFlapsTest.cpp",
        "CmdShowInterfaceStatusTest.cpp",
        "CmdShowInterfaceTest.cpp",
        "CmdShowInterfaceTrafficTest.cpp",
        "CmdShowL2Test.cpp",
        "CmdShowLldpTest.cpp",
        "CmdShowMirrorTest.cpp",
        "CmdShowNdpTest.cpp",
        "CmdShowPortTest.cpp",
        "CmdShowProductDetailsTest.cpp",
        "CmdShowProductTest.cpp",
        "CmdShowRouteDetailsTest.cpp",
        "CmdShowRouteSummaryTest.cpp",
        "CmdShowTeFlowTest.cpp",
        "CmdShowTransceiverTest.cpp",
        "CmdStartPcapTest.cpp",
        "CmdStopPcapTest.cpp",
    ],
    deps = [
        "fbsource//third-party/googletest:gmock",
        ":cmd_test_utils",
        "//configerator/structs/neteng/fboss/bgp:bgp_config-cpp2-types",
        "//fboss/agent:address_utils",
        "//fboss/agent/if:common-cpp2-types",
        "//fboss/agent/if:ctrl-cpp2-types",
        "//fboss/cli/fboss2:fboss2-lib",
        "//fboss/cli/fboss2/commands/show/acl:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/agent:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/aggregateport:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/arp:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/cpuport:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/example:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/flowlet:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/hardware:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/host:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/hwagent:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/interface:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/interface/counters:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/interface/errors:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/interface/flaps:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/interface/status:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/interface/traffic:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/lldp:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/mirror:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/ndp:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/port:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/product:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/route:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/teflow:model-cpp2-types",
        "//fboss/cli/fboss2/commands/show/transceiver:model-cpp2-types",
        "//folly:network_address",
        "//folly/json:dynamic",
        "//neteng/fboss/bgp/if:bgp_thrift-cpp2-services",
        "//nettools/common:TestUtils",
    ],
    external_deps = [("boost", None, "boost_algorithm")],
)
